package com.scsj.supermarket.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.scsj.supermarket.R;
import com.scsj.supermarket.bean.BalanceBean;
import com.scsj.supermarket.bean.GetTradeRecordListBean;

import java.util.List;

/**
 * 余额
 */

public class BalanceAdapter extends BaseQuickAdapter<GetTradeRecordListBean.DataBean.ListBean,BaseViewHolder>{

    public BalanceAdapter(List data) {
        super(R.layout.item_balance_detail, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GetTradeRecordListBean.DataBean.ListBean item) {
//        helper.setText(R.id.month_tv,item.getDate());
        String type = "";
        switch (item.getTradeType()){
            case 1:
                type = "消费";
                break;
            case 2:
                type = "结算";
                break;
            case 3:
                type = "退款";
                break;
            case 4:
                type = "充值";
                break;
            case 5:
                type = "提现";
                break;
            case 6:
                type = "分销";
                break;
        }
        helper.setText(R.id.title_tv,type);
        helper.setText(R.id.time_tv,item.getFinnshedTime());
//        helper.setText(R.id.name_tv,item.getMoney()+"");
        helper.setText(R.id.money_tv,item.getTradeTrueAmount());
    }
}
